import 'package:json_annotation/json_annotation.dart';

part 'homeworkstudentinfo.g.dart';

@JsonSerializable()
class HomeworkStudentInfo {
  String words;
  String nextStuHomeworkId;
  String preStuHomeworkId;
  String evaluateResult;
  String openTime;
  String submitTime;
  String reviewTime;
  String studentName;
  String evaluateInfo;
  List<HomeworkImgList> imgList;
  List<HomeworkAudioList> audioList;
  List<HomeworkVideoList> videoList;

  HomeworkStudentInfo(
      {this.words,
      this.nextStuHomeworkId,
      this.preStuHomeworkId,
      this.evaluateResult,
      this.openTime,
      this.submitTime,
      this.studentName,
      this.evaluateInfo,
      this.reviewTime,
      this.imgList,
      this.audioList,
      this.videoList});

  //反序列化
  factory HomeworkStudentInfo.fromJson(Map<String, dynamic> json) =>
      _$HomeworkStudentInfoFromJson(json);
//序列化
  Map<String, dynamic> toJson() => _$HomeworkStudentInfoToJson(this);
}

class HomeworkImgList {
  String imgUrl;
  String homeworkDetailId;

  HomeworkImgList({this.imgUrl, this.homeworkDetailId});

  HomeworkImgList.fromJson(Map<String, dynamic> json) {
    imgUrl = json['imgUrl'];
    homeworkDetailId = json['homeworkDetailId'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['imgUrl'] = this.imgUrl;
    data['homeworkDetailId'] = this.homeworkDetailId;
    return data;
  }
}

class HomeworkAudioList {
  String audioUrl;
  String homeworkDetailId;

  HomeworkAudioList({this.audioUrl, this.homeworkDetailId});

  HomeworkAudioList.fromJson(Map<String, dynamic> json) {
    audioUrl = json['audioUrl'];
    homeworkDetailId = json['homeworkDetailId'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['audioUrl'] = this.audioUrl;
    data['homeworkDetailId'] = this.homeworkDetailId;
    return data;
  }
}

class HomeworkVideoList {
  String videoUrl;
  String homeworkDetailId;

  HomeworkVideoList({this.videoUrl, this.homeworkDetailId});

  HomeworkVideoList.fromJson(Map<String, dynamic> json) {
    videoUrl = json['videoUrl'];
    homeworkDetailId = json['homeworkDetailId'];
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> data = new Map<String, dynamic>();
    data['videoUrl'] = this.videoUrl;
    data['homeworkDetailId'] = this.homeworkDetailId;
    return data;
  }
}
